//
//  QRImageController.m
//  QRBuildScan
//
//  Created by gongjie on 12-1-3.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "QRImageController.h"

@implementation QRImageController
@synthesize qi_leftbuttn;
//- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
//{
//    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
//    if (self) {
//        // Custom initialization
//    }
//    return self;
//}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{
}
*/

-(id)init{
    if (self = [super init]) {
        qi_leftbuttn = [UIButton buttonWithType:UIButtonTypeCustom];
        qi_leftbuttn.frame = CGRectMake(10,7, 60, 30);
        [qi_leftbuttn setBackgroundImage:[UIImage imageNamed:@"xiang.png"] forState:UIControlStateNormal];
        [qi_leftbuttn addTarget:self action:@selector(changhQIWleft) forControlEvents:UIControlEventTouchUpInside];
        [qi_leftbuttn retain];
        qi_imageview = [[UIImageView alloc] initWithFrame:CGRectMake(20, 20, 280, 280)];
        [qi_imageview setBackgroundColor:[UIColor blueColor]];
        [self.view addSubview:qi_imageview];
    }
    return self;
}
-(void)setImageShow:(NSString*)imagpath
{
    NSLog(@"dsaf %@",imagpath);
    if (qi_imageview !=nil&&imagpath!=nil&&imagpath !=@"") {
        [qi_imageview setImage:[UIImage imageWithContentsOfFile:imagpath]];
    }
}
-(void)changhQIWleft
{
    if (qi_leftbuttn.superview) {
        [qi_leftbuttn removeFromSuperview];
    }
    [self.navigationController popViewControllerAnimated:YES];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];

}


- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
-(void)dealloc
{
    [qi_imageview release];
     qi_leftbuttn =nil;
    [super dealloc];
}

@end
